package com.notices.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.notices.mapper.NoticestypeMapper;
import com.notices.pojo.Noticestype;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NoticestypeServiceImpl implements INoticestypeService {
    @Autowired
    private NoticestypeMapper mapper;


    @Override
    public List<Noticestype> list() {
        return mapper.selectList(new QueryWrapper<>());
    }

    @Override
    public Noticestype getById(Integer id) {
        return mapper.selectById(id);
    }

    @Override
    public Integer add(Noticestype noticesType) {
        return mapper.insert(noticesType);
    }

    @Override
    public Integer update(Noticestype noticesType) {
        return mapper.updateById(noticesType);
    }

    @Override
    public Integer delete(Integer id) {
        return mapper.deleteById(id);
    }

}
